package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.CirculationB232;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class CirculationB232Converter implements AttributeConverter<CirculationB232, String> {
    @Override
    public String convertToDatabaseColumn(CirculationB232 circulationB232) {
        return JSONUtil.toJsonStr(circulationB232);
    }

    @Override
    public CirculationB232 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, CirculationB232.class);
    }
}
